home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 131
/
XENIATGM131.iso
/
Shareware
/
openOffice.org 641
/
Windows
/
f_0158
/
main_transform.xsl
< prev
Wrap
Extensible Markup Language
|
2001-09-10
|
27KB
|
802 lines
<?xml version="1.0" encoding="UTF-8"?>
<!--
++++++++++++++++++++++++++++++++++++++++++++++++++++++
This is the transformation style sheet for Help files.
(c) 2001 by Sun Microsystems, Inc. All Rights Reserved
++++++++++++++++++++++++++++++++++++++++++++++++++++++
You should not edit this file unless you know what
you're doing.
Version: 30-AUG-01 FPE
27-Jul-01: Evaluation of $Program does not work. Talk to ABI
about that. In the meantime, declare $Prog for the same
purposes (PRELIMINARY!!!)
09-Aug-01: Added evaluation of th in "How to get"-popups.
Changed evaluation of icon/name tables within that.
09-Aug-01: Added special formatting of "Related" header (styleclass "reltop")
09-Aug-01: Added variable for column width of first columns of tables with icons
14-Aug-01: Fixed Bug: Switches were not evaluated in document title h1
14-Aug-01: Fixed Bug: System switches were falsely evaluated. Changed the way of switch
evaluation, now using modes.
17-AUG-01: Fixed Bug: switch as direct child of embedded were not evaluated
22-Aug-01: Fixed: Axis PRECEDING no longer used (wasn't supported by processor)
22-Aug-01: Now empty Howtoget links are ignored
27-Aug-01: Now the image size is evaluated (from cm to pixels) and included in the img tags.
28-Aug-01: Embedded Paras now check for a <p> ancestor instead of a parent.
30-Aug-01: Added recursive evaluation of embedded text
//-->
<xsl:stylesheet version="1.0"
xmlns:nu="http://www.jclark.com/xt/java/com.sun.xmlsearch.tree.NodeUtils"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:office="http://openoffice.org/2000/office"
xmlns:style="http://openoffice.org/2000/style"
xmlns:text="http://openoffice.org/2000/text"
xmlns:table="http://openoffice.org/2000/table"
xmlns:draw="http://openoffice.org/2000/drawing"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:meta="http://openoffice.org/2000/meta"
xmlns:number="http://openoffice.org/2000/datastyle"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:chart="http://openoffice.org/2000/chart"
xmlns:help="http://openoffice.org/2000/help">
<!-- Generate html code -->
<xsl:output method="html"/>
<!-- These are the parameters for the help URL prefix -->
<xsl:param name="hp" select="''"/>
<xsl:param name="sm" select="'vnd.sun.star.help://'"/>
<xsl:param name="qm" select="'?'"/>
<xsl:param name="es" select="'='"/>
<xsl:param name="am" select="'&'"/>
<xsl:param name="cl" select="':'"/>
<xsl:param name="sl" select="'/'"/>
<xsl:param name="hm" select="'#'"/>
<!-- Possible values are OFFICE, swriter, scalc, sbasic, schart, sdraw, simpress, smath, portal -->
<xsl:param name="Database" select="'swriter'"/>
<!--
Die Auswertung von $Program erfolgt scheinbar nicht richtig. R├╝cksprache mit ABI n├╢tig
<xsl:param name="Program" select="$Database"/>
daher vorläufig mit einer neuen Var arbeiten
-->
<xsl:variable name="Program">
<xsl:choose>
<xsl:when test="$Database='swriter'">WRITER</xsl:when>
<xsl:when test="$Database='scalc'">CALC</xsl:when>
<xsl:when test="$Database='sdraw'">DRAW</xsl:when>
<xsl:when test="$Database='simpress'">IMPRESS</xsl:when>
<xsl:when test="$Database='sbasic'">BASIC</xsl:when>
<xsl:when test="$Database='smath'">MATH</xsl:when>
<xsl:when test="$Database='schart'">CHART</xsl:when>
<xsl:when test="$Database='portal'">PORTAL</xsl:when>
<xsl:otherwise>NONE</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Fixed width of first column of tables containing icons in the first column -->
<xsl:variable name="colwidth_1">25</xsl:variable>
<!-- Possible values for Language: see language codes The XML companion s.438 -->
<xsl:param name="Language" select="'de'"/>
<!-- Possible values for System are WIN, OS2, MAC, and UNIX -->
<xsl:param name="System" select="'WIN'"/>
<xsl:param name="Device" select="'WARP'"/>
<xsl:param name="Id" select="'0000'"/>
<xsl:param name="Path" select="'Path'"/>
<!-- Temporarily disabled by SUS
<xsl:param name="deviceType" select="'HTML4'"/>
-->
<!-- Copy trough of elements with attributes -->
<xsl:template match="*|@*|comment()|processing-instruction()|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="help:*">
<xsl:element name="{name()}">
<xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
</xsl:element>
</xsl:template>
<!--Normal processing of elements starts here -->
<xsl:template match="help:help-id|help:to-be-embedded">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="help:to-popup">
<xsl:apply-templates/>
</xsl:template>
<!-- Show visible active help AVIS, hide hidden active help AHID -->
<xsl:template match="help:help-text">
<xsl:if test="@value='visible'">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<!-- Evaluate switch statements -->
<xsl:template match="help:switch">
<xsl:choose>
<xsl:when test="@select='Program'">
<xsl:apply-templates mode="switch_prog"/>
</xsl:when>
<xsl:when test="@select='System'">
<xsl:apply-templates mode="switch_sys"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="help:switch" mode="embedded">
<xsl:choose>
<xsl:when test="@select='Program'">
<xsl:apply-templates mode="switch_prog"/>
</xsl:when>
<xsl:when test="@select='System'">
<xsl:apply-templates mode="switch_sys"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="help:case" mode="switch_prog">
<xsl:if test="@select=$Program">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<xsl:template match="help:case" mode="switch_sys">
<xsl:if test="@select=$System">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<xsl:template match="help:default" mode="switch_prog">
<xsl:if test="not(../help:case[@select=$Program])">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<xsl:template match="help:default" mode="switch_sys">
<xsl:if test="not(../help:case[@select=$System])">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<!-- //\\ -->
<xsl:template match="help:switch" mode="doctitle">
<xsl:if test="@select='Program' or @select='System'">
<xsl:apply-templates mode="doctitle"/>
</xsl:if>
</xsl:template>
<xsl:template match="help:case" mode="doctitle">
<xsl:if test="@select=$Program or @select=$System">
<xsl:apply-templates mode="doctitle"/>
</xsl:if>
</xsl:template>
<xsl:template match="help:default" mode="doctitle">
<xsl:if test="../../help:switch[@select='System'] and not(../help:case[@select=$System])">
<xsl:apply-templates mode="doctitle"/>
</xsl:if>
<xsl:if test="../../help:switch[@select='Program'] and not(../help:case[@select=$Program])">
<xsl:apply-templates mode="doctitle"/>
</xsl:if>
</xsl:template>
<xsl:template match="p" mode="embedded">
<xsl:choose>
<xsl:when test="@class='Head1'">
<xsl:element name="hr">
<xsl:attribute name="width">50%</xsl:attribute>
<xsl:attribute name="align">center</xsl:attribute>
<xsl:attribute name="size">1</xsl:attribute>
</xsl:element>
<xsl:element name="p">
<xsl:attribute name="class">Head2</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:when test="@class='Head2'">
<xsl:element name="p">
<xsl:attribute name="class">Head2</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:when test="@class='Head3'">
<xsl:element name="p">
<xsl:attribute name="class">Head3</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:when test="@class='Paragraph' or @class='ParaList' or @class='TextInTable' or @class='TableHead' or @class='PropText'">
<xsl:element name="p">
<xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="p">
<xsl:attribute name="class">Paragraph</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="p" mode="popup">
<xsl:if test="(. != '') or (count(child::*)>0)">
<xsl:element name="p">
<xsl:attribute name="class">howtogetpara</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Process Paragraphs and Headers -->
<xsl:template match="p">
<!-- Disregard empty paragraphs -->
<xsl:choose>
<xsl:when test=".='' and count(child::*)=0">
</xsl:when>
<xsl:otherwise>
<!-- Process all headings -->
<xsl:choose>
<xsl:when test="substring(@class,1,4)='Head'">
<xsl:choose>
<xsl:when test="@class='Head1'">
<!--
<xsl:choose>
<xsl:when test="preceding::p[@class='Head1']"> There may only be 1 H1 (at the top)
<xsl:element name="hr">
<xsl:attribute name="width">50%</xsl:attribute>
<xsl:attribute name="align">center</xsl:attribute>
<xsl:attribute name="size">1</xsl:attribute>
</xsl:element>
<xsl:element name="p">
<xsl:attribute name="class">Head2</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
//-->
<!-- this is the document title at the top (hopefully...) -->
<xsl:element name="table">
<xsl:attribute name="width">100%</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="cellspacing">1</xsl:attribute>
<xsl:attribute name="cellpadding">3</xsl:attribute>
<xsl:attribute name="class">doctablebg</xsl:attribute>
<xsl:element name="tr">
<xsl:attribute name="class">doctitlebg</xsl:attribute>
<xsl:element name="td">
<xsl:attribute name="class">Head1</xsl:attribute>
<xsl:apply-templates mode="doctitle"/>
</xsl:element>
</xsl:element>
</xsl:element>
<xsl:element name="br"/>
<!--
</xsl:otherwise>
</xsl:choose>
//-->
</xsl:when>
<xsl:when test="@class='Head2'">
<xsl:element name="hr">
<xsl:attribute name="width">50%</xsl:attribute>
<xsl:attribute name="align">center</xsl:attribute>
<xsl:attribute name="size">1</xsl:attribute>
</xsl:element>
<xsl:element name="p">
<xsl:attribute name="class">Head2</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="p">
<xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!--
Process all paragraphs and adjust automatic style information
Valid style classes are Paragraph, ParaList, TextInTable, TableHead, PropText
-->
<xsl:when test="@class='Paragraph' or @class='ParaList' or @class='TextInTable' or @class='TableHead' or @class='PropText'">
<xsl:element name="p">
<xsl:choose>
<!-- By special request, turn the "Related Topics" header into an own style class -->
<xsl:when test="child::help:embedded[@Eid='related']">
<xsl:attribute name="class">reltop</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="p">
<xsl:attribute name="class">Paragraph</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- process all kinds of lists -->
<xsl:template match="ol">
<xsl:element name="ol">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="ul">
<xsl:element name="ul">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="li">
<xsl:element name="li">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="ol" mode="Embedded">
<xsl:element name="ol">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="ul" mode="Embedded">
<xsl:element name="ul">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!-- Process character formatting -->
<xsl:template match="span">
<!-- Disregard spans with table automatic formats, starting with "Tabelle" -->
<xsl:choose>
<xsl:when test="substring(@class,1,7)='Tabelle'">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<!-- insert emphasized span -->
<xsl:element name="span">
<xsl:attribute name="class">emph</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="span" mode="embedded">
<!-- Disregard spans with table automatic formats, starting with "Tabelle" -->
<xsl:choose>
<xsl:when test="substring(@class,1,7)='Tabelle'">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<!-- insert emphasized span -->
<xsl:element name="span">
<xsl:attribute name="class">emph</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="span" mode="popup">
<!-- Disregard spans with table automatic formats, starting with "Tabelle" -->
<xsl:choose>
<xsl:when test="substring(@class,1,7)='Tabelle'">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<!-- insert emphasized span -->
<xsl:element name="span">
<xsl:attribute name="class">emph</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Tables should be preceded and followed by a line break -->
<xsl:template match="table">
<xsl:element name="br"/>
<xsl:element name="table">
<xsl:if test="@border>0">
<xsl:attribute name="border">1</xsl:attribute>
<xsl:attribute name="class">tablebg</xsl:attribute>
</xsl:if>
<xsl:attribute name="cellspacing">0</xsl:attribute>
<xsl:attribute name="cellpadding">2</xsl:attribute>
<xsl:apply-templates />
</xsl:element>
<xsl:element name="br"/>
</xsl:template>
<xsl:template match="table" mode="embedded">
<xsl:element name="br"/>
<xsl:element name="table">
<xsl:if test="@border>0">
<xsl:attribute name="border">1</xsl:attribute>
<xsl:attribute name="class">tablebg</xsl:attribute>
</xsl:if>
<xsl:attribute name="cellspacing">0</xsl:attribute>
<xsl:attribute name="cellpadding">2</xsl:attribute>
<xsl:apply-templates />
</xsl:element>
<xsl:element name="br"/>
</xsl:template>
<xsl:template match="table" mode="popup">
<xsl:element name="table">
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="cellspacing">0</xsl:attribute>
<xsl:attribute name="cellpadding">2</xsl:attribute>
<xsl:apply-templates mode="popup"/>
</xsl:element>
<!-- <xsl:for-each select="child::tr">
<xsl:element name="p">
<xsl:attribute name="class">howtogetpara</xsl:attribute>
<xsl:if test="(child::td) or (child::th)">
<xsl:apply-templates mode="popup"/>
</xsl:if>
</xsl:element>
</xsl:for-each>
//-->
</xsl:template>
<xsl:template match="tr">
<xsl:element name="tr">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="tr" mode="popup">
<xsl:element name="tr">
<xsl:apply-templates mode="popup"/>
</xsl:element>
</xsl:template>
<xsl:template match="th">
<!-- no th for borderless tables - 24/07/01-->
<xsl:choose>
<xsl:when test="../../table[@border>0]">
<xsl:element name="th">
<xsl:attribute name="align">left</xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
<xsl:attribute name="class">tableheadbg</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="td">
<xsl:attribute name="align">left</xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
<xsl:attribute name="class">tabledatabg</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="td" mode="popup">
<xsl:element name="td">
<xsl:if test="descendant::draw:image">
<xsl:attribute name="width"><xsl:value-of select="$colwidth_1"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="popup"/>
</xsl:element>
</xsl:template>
<xsl:template match="th" mode="popup">
<xsl:element name="td">
<xsl:if test="descendant::draw:image">
<xsl:attribute name="width"><xsl:value-of select="$colwidth_1"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates mode="popup"/>
</xsl:element>
</xsl:template>
<xsl:template match="td">
<xsl:element name="td">
<xsl:attribute name="align">left</xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
<xsl:attribute name="class">tabledatabg</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!-- Process embedded help text -->
<xsl:template match="help:embedded">
<xsl:variable name="Link" select="concat($sm,$Database,'/',@Id,'?Language=',$Language,'&System=',$System)"/>
<xsl:variable name="EmbeddedDoc" select="document($Link)"/>
<xsl:variable name="Docpart" select="@Eid"/>
<xsl:choose>
<!-- prevent embedded paragraphs without p tag -->
<xsl:when test="not(ancestor::p)">
<xsl:element name="p">
<xsl:attribute name="class">Paragraph</xsl:attribute>
<xsl:apply-templates select="$EmbeddedDoc//help:to-be-embedded[@Eid=$Docpart]" mode="embedded"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$EmbeddedDoc//help:to-be-embedded[@Eid=$Docpart]" mode="embedded"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Process embedded help text -->
<xsl:template match="help:embedded" mode="embedded">
<xsl:variable name="Link" select="concat($sm,$Database,'/',@Id,'?Language=',$Language,'&System=',$System)"/>
<xsl:variable name="EmbeddedDoc" select="document($Link)"/>
<xsl:variable name="Docpart" select="@Eid"/>
<xsl:choose>
<!-- prevent embedded paragraphs without p tag -->
<xsl:when test="not(ancestor::p)">
<xsl:element name="p">
<xsl:attribute name="class">Paragraph</xsl:attribute>
<xsl:apply-templates select="$EmbeddedDoc//help:to-be-embedded[@Eid=$Docpart]" mode="embedded"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$EmbeddedDoc//help:to-be-embedded[@Eid=$Docpart]" mode="embedded"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Process Popup help text -->
<xsl:template match="help:popup-cut">
<xsl:variable name="ref" select="concat($sm,$Database,'/',@Id,'?Language=',$Language,'&System=',$System)"/>
<xsl:variable name="popupdoc" select="document($ref)"/>
<xsl:variable name="part" select="@Eid"/>
<xsl:apply-templates select="$popupdoc//help:to-popup[@Eid=$part]"/>
<xsl:element name="hr">
<xsl:attribute name="width">50%</xsl:attribute>
<xsl:attribute name="align">center</xsl:attribute>
<xsl:attribute name="size">1</xsl:attribute>
</xsl:element>
</xsl:template>
<!-- Process anchor names (help index keywords) -->
<xsl:template match="help:key-word">
<xsl:element name="a">
<xsl:attribute name="name">
<xsl:value-of select="@tag"/>
</xsl:attribute>
</xsl:element>
</xsl:template>
<xsl:template match="help:key-word" mode="doctitle">
<xsl:element name="a">
<xsl:attribute name="name">
<xsl:value-of select="@tag"/>
</xsl:attribute>
</xsl:element>
</xsl:template>
<!-- Process anchor names (help ids) -->
<xsl:template match="help:help-id">
<xsl:element name="a">
<xsl:attribute name="name">
<xsl:value-of select="@value"/>
</xsl:attribute>
</xsl:element>
</xsl:template>
<xsl:template match="help:help-id" mode="doctitle">
<xsl:element name="a">
<xsl:attribute name="name">
<xsl:value-of select="@value"/>
</xsl:attribute>
</xsl:element>
</xsl:template>
<!-- Process help links -->
<xsl:template match="help:link">
<xsl:choose>
<xsl:when test="@Eid">
<xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System,'#',@Eid)"/>
<xsl:element name="a">
<xsl:attribute name="class">ContentLink</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
<xsl:element name="a">
<xsl:attribute name="class">ContentLink</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="help:link" mode="embedded">
<xsl:choose>
<xsl:when test="@Eid">
<xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System,'#',@Eid)"/>
<xsl:element name="a">
<xsl:attribute name="class">ContentLink</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
<xsl:element name="a">
<xsl:attribute name="class">ContentLink</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="help:link" mode="doctitle">
<xsl:apply-templates/>
</xsl:template>
<!-- Process help popups -->
<!-- Workaround for "How to get this function" popup is to load it in a small table into the document -->
<xsl:template match="help:popup">
<xsl:choose>
<xsl:when test="child::help:embedded[@Eid='wie']">
<xsl:variable name="Link" select="concat($sm,$Database,'/',@Id,'?Language=',$Language,'&System=',$System)"/>
<xsl:variable name="EmbeddedDoc" select="document($Link)"/>
<xsl:variable name="Docpart" select="@Eid"/>
<xsl:if test="$EmbeddedDoc//help:to-popup[@Eid=$Docpart]!=''">
<xsl:element name="table">
<xsl:attribute name="width">100%</xsl:attribute>
<xsl:attribute name="border">1</xsl:attribute>
<xsl:attribute name="cellspacing">0</xsl:attribute>
<xsl:attribute name="cellpadding">4</xsl:attribute>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:attribute name="class">howtogetheader</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:element>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:attribute name="class">howtogetbody</xsl:attribute>
<xsl:apply-templates select="$EmbeddedDoc//help:to-popup[@Eid=$Docpart]" mode="popup"/>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:if>
<xsl:element name="br"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System,$am,'Eid',$es,@Eid)"/>
<xsl:element name="a">
<xsl:attribute name="class">ContentLink</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Process images -->
<xsl:template match="draw:image | office:image">
<xsl:element name="img">
<xsl:variable name="pictureLink" select="concat($hp,$sm,'picture',$sl,@xlink:href,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
<xsl:attribute name="src"><xsl:value-of select="$pictureLink"/></xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="round(substring-before(@svg:width,'cm')*37.8)"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="round(substring-before(@svg:height,'cm')*37.8)"/></xsl:attribute>
</xsl:element>
</xsl:template>
<!-- temporarily disabled
<xsl:template match="img">
<xsl:if test="$deviceType = 'CSS' or $deviceType = 'HTML4'">
<xsl:variable name="pictureLink" select="concat($hp,$sm,'picture',$sl,@src,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
<img src="{$pictureLink}"/>
</xsl:if>
</xsl:template>
-->
<!-- Remove residues of formatting information -->
<xsl:template match="style">
</xsl:template>
<!-- Add CSS link to custom.css -->
<xsl:template match="help:css-file-link">
<xsl:variable name="CssStylesheet" select="concat($hp,$sm,$sl,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
<xsl:element name="link">
<xsl:attribute name="rel">STYLESHEET</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$CssStylesheet"/></xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
</xsl:element>
<!-- Add Encoding meta tag for correct display of asian text -->
<xsl:element name="meta">
<xsl:attribute name="http-equiv">Content-type</xsl:attribute>
<xsl:attribute name="content">text/html; charset=utf-8</xsl:attribute>
</xsl:element>
</xsl:template>
<!-- error handling -->
<xsl:template match="help:error-id">
<xsl:value-of select="$Id"/>
</xsl:template>
<xsl:template match="help:error-module">
<xsl:value-of select="$Database"/>
</xsl:template>
<xsl:template match="help:error-path">
<xsl:value-of select="$Path"/>
</xsl:template>
</xsl:stylesheet>